%ifndef BOOT_MEMORY_SEGMENTATION
%define BOOT_MEMORY_SEGMENTATION
%include "Boot/SegmentDescriptor.S"
%include "Boot/SegmentSelector.S"
; Segment selector
; 段描述符
%define CODE_SEGMENT_DESCRIPTOR  (SEGMENT_DESCRIPTOR_LIMIT | SEGMENT_DESCRITOR_BASE | SEGMENT_DESCRIPTOR_TYPE_CODE | SEGMENT_DESCRIPTOR_S_CODEDATA | SEGMENT_DESCRIPTOR_PRESENT | SEGMENT_DESCRIPTOR_DEFAULT32_BIG | SEGMENT_DESCRIPTOR_4KiB_GRANULARITY)
%define DATA_SEGMENT_DESCRIPTOR  (SEGMENT_DESCRIPTOR_LIMIT | SEGMENT_DESCRITOR_BASE | SEGMENT_DESCRIPTOR_TYPE_WRITE_READ | SEGMENT_DESCRIPTOR_S_CODEDATA | SEGMENT_DESCRIPTOR_PRESENT | SEGMENT_DESCRIPTOR_DEFAULT32_BIG | SEGMENT_DESCRIPTOR_4KiB_GRANULARITY)
%define GRAPHIC_COLOR_MODE_DATA_SEGMENT_DESCRIPTOR ((0X000F) | (0XF000 << 16) | (0x0A << 32) | (0x00 << 56) | SEGMENT_DESCRIPTOR_TYPE_WRITE_READ |  SEGMENT_DESCRIPTOR_S_CODEDATA | SEGMENT_DESCRIPTOR_PRESENT | SEGMENT_DESCRIPTOR_DEFAULT32_BIG | SEGMENT_DESCRIPTOR_4KiB_GRANULARITY)
%define GRAPHIC_BLACKWHITE_MODE_DATA_SEGMENT_DESCRIPTOR ((0X0007) | (0X0000 << 16) | (0x0B << 32) | (0x00 << 56) | SEGMENT_DESCRIPTOR_TYPE_WRITE_READ |  SEGMENT_DESCRIPTOR_S_CODEDATA | SEGMENT_DESCRIPTOR_PRESENT | SEGMENT_DESCRIPTOR_DEFAULT32_BIG | SEGMENT_DESCRIPTOR_4KiB_GRANULARITY)
%define GRAPHIC_TEXT_MODE_DATA_SEGMENT_DESCRIPTOR ((0x0007) | (0x8000 << 16) | (0x0B << 32) | (0x00 << 56) | SEGMENT_DESCRIPTOR_TYPE_WRITE_READ |  SEGMENT_DESCRIPTOR_S_CODEDATA | SEGMENT_DESCRIPTOR_PRESENT | SEGMENT_DESCRIPTOR_DEFAULT32_BIG | SEGMENT_DESCRIPTOR_4KiB_GRANULARITY)
; 段选择子
%define SEGMENT_SELECTOR_CODE  (0x1 << 3)
%define SEGMENT_SELECTOR_DATA  (0x2 << 3)
%define SEGMENT_SELECTOR_COLOR (0x3 << 3)
%define SEGMENT_SELECTOR_BLACKWHITE (0x4 << 3)
%define SEGMENT_SELECTOR_GRAPHIC_TEXT_MODE (0x5 << 3)
%endif